package com.ruoyi.hotel.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hotel.mapper.HlMemberMapper;
import com.ruoyi.hotel.domain.HlMember;
import com.ruoyi.hotel.service.IHlMemberService;

/**
 * 会员权限Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-10
 */
@Service
public class HlMemberServiceImpl implements IHlMemberService 
{
    @Autowired
    private HlMemberMapper hlMemberMapper;

    /**
     * 查询会员权限
     * 
     * @param id 会员权限主键
     * @return 会员权限
     */
    @Override
    public HlMember selectHlMemberById(Integer id)
    {
        return hlMemberMapper.selectHlMemberById(id);
    }

    /**
     * 查询会员权限列表
     * 
     * @param hlMember 会员权限
     * @return 会员权限
     */
    @Override
    public List<HlMember> selectHlMemberList(HlMember hlMember)
    {
        return hlMemberMapper.selectHlMemberList(hlMember);
    }

    /**
     * 新增会员权限
     * 
     * @param hlMember 会员权限
     * @return 结果
     */
    @Override
    public int insertHlMember(HlMember hlMember)
    {
        hlMember.setCreateTime(DateUtils.getNowDate());
        return hlMemberMapper.insertHlMember(hlMember);
    }

    /**
     * 修改会员权限
     * 
     * @param hlMember 会员权限
     * @return 结果
     */
    @Override
    public int updateHlMember(HlMember hlMember)
    {
        hlMember.setUpdateTime(DateUtils.getNowDate());
        return hlMemberMapper.updateHlMember(hlMember);
    }

    /**
     * 批量删除会员权限
     * 
     * @param ids 需要删除的会员权限主键
     * @return 结果
     */
    @Override
    public int deleteHlMemberByIds(Long[] ids)
    {
        return hlMemberMapper.deleteHlMemberByIds(ids);
    }

    /**
     * 删除会员权限信息
     * 
     * @param id 会员权限主键
     * @return 结果
     */
    @Override
    public int deleteHlMemberById(Long id)
    {
        return hlMemberMapper.deleteHlMemberById(id);
    }

    /**
     * 通过类型查找会员权限信息
     *
     * @param memberType 主键
     * @return 结果
     */
    @Override
    public HlMember selectHlMemberByMemberType(String memberType) {
        return hlMemberMapper.selectHlMemberByMemberType(memberType);
    }
}
